home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 22 code / Paper Juggling / Shell Files / AppInterface.h next >
Encoding:
Text File  |  1995-03-06  |  4.1 KB  |  131 lines  |  [TEXT/MMCC]

  1. //---------------------------------------------------------------------
  2. //---------------------------------------------------------------------
  3. //
  4. //    Horrible Rickety Shell, by Dave Johnson
  5. //
  6. //    © Copyright 1985 - 1995 Anyone Who Wants It,
  7. //    All Rights Energetically Hurled as far away from me as possible.
  8. //    Use at your own (considerable) risk.
  9.  
  10. // Menu IDs and item numbers
  11. #define kAppleMenuID        128
  12.     #define    iAbout            1
  13.  
  14. #define kFileMenuID            129
  15.     #define    iNew            1
  16.     #define    iOpen            2
  17.     #define    iClose            3
  18.     #define    iSave            4
  19.     #define    iSaveAs            5
  20. //    -- divider --            6
  21.     #define    iPageSetup        7
  22.     #define    iPrint            8
  23.     #define    iPrintOne        9
  24. //    -- divider --            10 
  25.     #define    iQuit            11
  26.  
  27. #define kEditMenuID            130
  28.     #define    iUndo            1
  29.     #define    iCut            3
  30.     #define    iCopy            4
  31.     #define    iPaste            5
  32.     #define    iClear            6
  33.  
  34. // Indexes into global menu array
  35. #define kAppleMenu            0
  36. #define kFileMenu            1
  37. #define kEditMenu            2
  38.  
  39. // Protoypes for routines that app must provide
  40.  
  41. // Allow app a crack at raw event
  42. Boolean AppDoEvent(EventRecord *Event);
  43.  
  44. // The start and the end
  45. Boolean        AppInit(void);
  46. void         AppCleanUp(void);
  47.  
  48. // Events
  49. void         AppActivate(WindowPtr wind, Boolean activate);
  50. void         AppUpdate(WindowPtr wind);
  51. void         AppDrawContent(WindowPtr wind);
  52. void         AppIdle(EventRecord *event);
  53. void         AppClick(Point thePt, WindowPtr wind, Boolean doubleClick, EventRecord *eventptr);
  54. void         AppKeyDown(char key, EventRecord *eventptr);
  55. void         AppGrowWindow(WindowPtr wind, short hSize, short vSize);
  56. void         AppZoomWindow(WindowPtr wind, short zoomDir);
  57.  
  58. // Menus in general
  59. void        AppAdjustMenus(void);
  60. void         AppMenu(short id, short item);
  61.  
  62. // File Menu
  63. WindowPtr    AppNew(short numJugglers, short numCounts);
  64. void        AppOpen(void);
  65. void        AppClose(WindowPtr wind);
  66. Boolean        AppSave(WindowPtr wind);
  67. Boolean        AppSaveAs(WindowPtr wind);
  68. void        AppPageSetup(WindowPtr wind);
  69. OSErr        AppPrint(WindowPtr wind);
  70. OSErr        AppPrintOne(WindowPtr wind);
  71.  
  72. // Edit Menu
  73. void         AppUndo(void);
  74. void         AppCut(void);
  75. OSErr         AppCopy(void);
  76. void         AppPaste(void);
  77. void         AppClear(void);
  78.  
  79. // GX specific
  80. Boolean        SetUpGX(void);
  81. void        TearDownGX(void);
  82.  
  83.  
  84. //-------------------------------------------------------
  85. // ShellUtils.c, part of the shell, but we may need 'em
  86. int            abs(int i);
  87. long        labs(long i);
  88. Boolean     NewPixImage(PixMapHandle ThePix, Rect *TheRect, short dpth);
  89. Boolean     NewBitMap(BitMap *TheMap, Rect *TheRect);
  90. void         CenterRect(Rect *theRect, Point *thePt);
  91. Point         Center(Rect *theRect);
  92. short        NumToolboxTraps(void);
  93. TrapType    GetTrapType(short theTrap);
  94. Boolean        TrapAvailable(short theTrap);
  95. void        pcat255(StringPtr d, StringPtr s);
  96. void        pcat63(StringPtr d, StringPtr s);
  97. void        AppendStr31(StringPtr d, StringPtr s);
  98. char*         PStrCat(Str255 str1, Str255 str2, Boolean addSpace);
  99. void        PStrCopy(Str255 src, Str255 dst);
  100. void         AdjustScrollbars(WindowPtr wind, Boolean needsResize);
  101. void         AdjustScrollValues(WindowPtr wind);
  102. pascal void ScrollActionProc(ControlHandle control, short part);
  103. Boolean        AddStdScrollBars(WindowPtr wind);
  104. OSErr        InitStdDoc(WindowPtr wind);
  105. Boolean        CheckMachine(void);
  106. void        CalcWindowStats(void);
  107.  
  108. Boolean     IsAppWindow(WindowPtr wind);
  109. void         DoActivateUpdate(void);
  110. void         ReadyWZoom(WindowPtr wind, short zoomDir, short maxH, short maxV);
  111. void         CloseClip(WindowPtr wind);
  112. void         DoErrorAlert(short stringID1, short error);
  113. short         SaveChangesDlog(void);
  114. Boolean     CloseAllDocs(void);
  115. void         SetUpAndShowWindow(WindowPtr wind);
  116.  
  117. // GX-specific routines, mostly stolen from GX Shells by Dave Hersey and Pete Alexander
  118. Boolean        CheckQuickDrawGX (void);
  119. gxJob        GetWindowGXJob(WindowPtr wind);
  120. gxShape        GetWindowGXShape (WindowPtr wind);
  121. gxViewPort    GetWindowGXPort(WindowPtr wind);
  122. OSErr        AddWindowGXStuff(WindowPtr wind);
  123. void        GetGXWindowBounds(WindowPtr wind, gxRectangle *gxRectPtr);
  124. void        ResetGXClip(WindowPtr theWindow);
  125. void        DoScroll(WindowPtr theWindow, short hScroll, short vScroll, Boolean draw);
  126. OSErr        MyGXPrintingEventOverride (EventRecord *event, Boolean filterEvent);
  127. void        SetUpGXEditMenuRec(gxEditMenuRecord *);
  128. OSErr        DoGXFormatDialog(WindowPtr, gxDialogResult    *);
  129. OSErr        DoGXPrinting(WindowPtr);
  130. OSErr        DoGXPrintOne(WindowPtr, gxShape page);
  131.